package com.awa.usercenter.service.impl;

import com.awa.usercenter.common.Code;
import com.awa.usercenter.exception.BusinessException;
import com.awa.usercenter.mapper.CompanyAuthMapper;
import com.awa.usercenter.model.domain.CompanyAuth;
import com.awa.usercenter.service.CompanyAuthService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
@Slf4j
public class CompanyAuthImpl extends ServiceImpl<CompanyAuthMapper, CompanyAuth> implements CompanyAuthService {
    @Autowired
    CompanyAuthMapper companyAuthMapper;
    @Override
    public boolean accept(long auth_id) {
        CompanyAuth companyAuth = companyAuthMapper.selectById(auth_id);
        if(companyAuth!=null)
        {
            companyAuth.setStatus(1);
            companyAuthMapper.updateById(companyAuth);
            //todo company插入数据
            return true;
        }
        else throw new BusinessException(Code.PARAMS_ERROR);
    }
}




